import request from '@/config/axios'

// 附件详情信息 VO
export interface DetailsVO {
  attachmentId: number // 主键
  mimeType: string // 文件mimeType
  fileName: string // 文件名称
  fileSize: number // fileSize
  filePath: string // 文件路径
  createdBy: number // 创建人
  createdTime: Date // 创建时间
}

// 附件详情信息 API
export const DetailsApi = {
  // 查询附件详情信息分页
  getDetailsPage: async (params: any) => {
    return await request.get({ url: `/attachment/details/page`, params })
  },

  // 查询附件详情信息详情
  getDetails: async (id: number) => {
    return await request.get({ url: `/attachment/details/get?id=` + id })
  },

  // 新增附件详情信息
  createDetails: async (data: DetailsVO) => {
    return await request.post({ url: `/attachment/details/create`, data })
  },

  // 修改附件详情信息
  updateDetails: async (data: DetailsVO) => {
    return await request.put({ url: `/attachment/details/update`, data })
  },

  // 删除附件详情信息
  deleteDetails: async (id: number) => {
    return await request.delete({ url: `/attachment/details/delete?id=` + id })
  },

  // 导出附件详情信息 Excel
  exportDetails: async (params) => {
    return await request.download({ url: `/attachment/details/export-excel`, params })
  },
}